<template>
  <p>
    每次增加1：<button @click="increases">+</button>
    数字：{{add }}
  </p>

  <p>
    每次减少1：<button @click="reduset">-</button>
    数字：{{ reduce }}
  </p>
</template>

<script setup>
import {useStore} from './store'
import {storeToRefs} from 'pinia'
const store=useStore();
const {add,reduce}=storeToRefs(store)
const increases=()=>{
  store.increase()
}
const reduset=()=>{
  store.reduse()
}

</script>

<style>
button{
  background-color: aqua;
}
</style>